const mongoose = require("mongoose")
const Schema = mongoose.Schema


const Video_type = {
    title: {
        type: String,
        required: [true, '必填标题'],
    },
    cover_img: {
        type: String,
        required: [true, '必填封面'],
    },
    rich_text: {
        type: String,
        required: [true, '必填富文本'],
    },
    textual: {
        type: String,
        required: [true, '必填']
    },
    view: {
        type: Number,
        default: 0
    },
    likes: {
        type: Array,
        default: []
    },
    comment: {
        type: Number,
        default: 0
    },
    publish_time: {
        type: Number,
        default: Date.now()
    },
    end_time: {
        type: Number,
        default: Date.now()
    },
    video_url: {
        type: String,
        default: ""
    }
}


const Video_Model = mongoose.model("Video", new Schema(Video_type))

module.exports = Video_Model